package com.lgx.right.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lgx.common.basic.dao.GeneralJdbcDao;
import com.lgx.common.exception.DataException;
import com.lgx.right.dao.IUserExpandDao;
import com.lgx.right.entity.UserExpand;
import com.lgx.right.service.IUserExpandService;

/**
 * 用户Service
 * 
 * @author acer
 *
 */
@Service("userExpandService")
public class UserExpandService implements IUserExpandService {

	@Autowired
	private IUserExpandDao userExpandDao;
	
	public IUserExpandDao getUserExpandDao() {
		return userExpandDao;
	}

	public void setUserExpandDao(IUserExpandDao userExpandDao) {
		this.userExpandDao = userExpandDao;
	}

	@Autowired
	private GeneralJdbcDao baseDao;
	
	public GeneralJdbcDao getBaseDao() {
		return baseDao;
	}

	public void setBaseDao(GeneralJdbcDao baseDao) {
		this.baseDao = baseDao;
	}

	@Transactional
	public UserExpand createUserExpand(UserExpand userExpand) throws DataException {
		return this.userExpandDao.createUserExpand(userExpand);
	}

	@Transactional
	public UserExpand updateUserExpand(UserExpand userExpand) throws DataException {
		return this.userExpandDao.updateUserExpand(userExpand);
	}

	@Transactional
	public void deleteUserExpand(UserExpand userExpand) throws DataException {
		this.userExpandDao.deleteUserExpand(userExpand);
	}

	@Transactional
	public void deleteUserExpandById(long id) throws DataException {
		this.userExpandDao.deleteUserExpandById(id);
	}

	public UserExpand findUserExpandById(long id) {
		return this.userExpandDao.findUserExpandById(id);
	}
	
	public UserExpand findUserExpandByUserId(long userId){
		return this.userExpandDao.findUserExpandByUserId(userId);
	}
	
	public List<UserExpand> findUserExpandListByPoints(long userId,int x,int y){
		return this.userExpandDao.findUserExpandListByPoints(userId,x,y);
	}

	public List<UserExpand> findUserExpandList() {
		return this.userExpandDao.findUserExpandList();
	}
}
